-
Notifications
You must be signed in to change notification settings - Fork 68
Draft: Internationalization for fortran-lang #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How does the translation work? I couldn't figure it out ---- do you just translate the text, or do you need to copy the html for each language, which becomes redundant? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the looks of it, the file and folder names of the language should follow the ordinary abbreviations, like "de" for German, "fr" for French etc. Perhaps this can be stressed.
In the SymPy webpage, only the text itself is translated, all the markup is reused from the parent. So that way you are free to change the layout and all translations will still work. Furthermore, if you change a text in the English version, the translated version will simply show the English text until it is translated. So translations are always up to date in both layout and text (although parts of the text might not always be translated until somebody updates it). Unless we can figure out something similar, it will become a nightmare to make any changes to the English page, as it will not be reflected in the translations, neither in layout nor text. |
I have translated the keywords in my
|
@vmagnin Thanks for testing, I noticed a few missing keywords while skimming through the code yesterday, but found no time to push another patch before midnight. There was one RSS client sentence that was difficult to localize as it was using liquid templating inside to generate some links, so the general setup of this sentence + link generation needs reconsideration first. Might have been this one. |
@awvwgk , Concerning the "Packages" page, the section |
This might be partly due to the page titles, which are not localized yet but taken directly from the front matter of the main tree. They have to be handled differently for some reason. |
Hi Sebastian @awvwgk my translations of the homepage
I will now begin translating the other main sub-pages, at a slower pace. |
@vmagnin First, that's really amazing. It also means I better hurry up here ;). Let's try to keep things simple. If you are fine with rebasing your changes on my |
Yes, I have found a way to separate the content from the markup, just have to push the patch here. |
Patch is in, basically we can exploit that no document in the |
I think I got everything now, but more eyes will help to catch oversights and mistakes. Let's have a #build_preview for this PR. |
This PR has been built with Jekyll and can be previewed at: https://fortran-lang.org/pr/201/ |
Thanks @awvwgk |
I hope to help with these eyes. I think it's great that information about Fortran can be released in other languages. The |
This PR has been built with Jekyll and can be previewed at: https://fortran-lang.org/pr/201/ |
I would suggest to keep the javascript changes for separate patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic effort everyone! The proposed internationalisation mechanism looks good and appears to works well. I spotted just one broken link: the news archive button at the bottom of the news page.
Finally, what are the guidelines for future PRs that change existing content or add new pages?
If localized content is changed this has to be documented somehow. In case one of the content blocks of the main page is changed all localized versions should be updated. I suggest to open an issue under the Added content is less problematic, because in the |
@awvwgk Would the changes be added by pull request or by a procedure like that used for the French and Spanish preliminary versions? I suggest add to checklist, in the patch of infrastructure for localization, the |
Either way would work, can't tell which will be best in practice.
I opened #211 for the |
maybe, Checklist to keep track of translation to Every section corresponds to an item of navigation menu
|
How do we want to proceed with this patch? I would love to see it merged sooner than later since it basically touches every file in the repository and will therefore be very likely to collide with most other patches and PRs. |
I think we might be able to use this work to get to the state where I think we should get. However, I am afraid we are not there. For example, I can see a file like this in this PR:
And that I strongly believe is not the way to do it, because it is replicating the markup in every translation. So the minute we change the layout in the English version, all the translations will be wrong. It should not be the job of translators to fiddle with markup and trying to reproduce the English one. Neither should it be the job of contributors who improve the layout to do so in 30+ languages. I strongly believe the way to do it is to translate just the sentences / paragraphs / words and use automated system to show immediately in each translation what sentences got updated and must be translated. Markup should be correct right away. Note: You can look at the SymPy webpage where we do exactly what I described. |
SymPy is using a |
I agree; it looks to me that the duplicated markup here is isolated to a few |
The main issue with the plugin used here is that we don't get safe fallbacks in case we use the
|
Thanks for explaining and I see why the gettext approach would be much more preferable. It is a shame that those plugins have been discontinued. |
I would claim this patch is how far we can get with jekyll, unless we want to start maintaining a plugin ourselves for this purpose or switch to a different static page generator with better internationalization support. I checked hugo already as a simple replacement for jekyll with built-in internationalization, but it basically offers the same solution we have in the patch here. Check gohugoio/hugo#1744 (comment) why hugo is not using |
Does Jekyll allow to translate a sentence by sentence? It will be really tough for translators to try to figure out which parts of the English versions got updated. |
I think this PR is stuck at the moment. I won't pursue this particular approach further, which doesn't mean I will stop searching for a solution for the localization of the webpage. The translations of @aslozada and @vmagnin won't be lost with this PR, merely delayed until I figured out a better solution. Anyone participating in the discussion here is invited to join the search for a suitable static side generator with better localization support at #89. |
I have just committed the French translation of the compilers.md page in my fork, corresponding to the latest 2021-03-06 English version: |
I guess it is time to close this topic, we can revive this branch from 1fb9900 to get the wonderful translations already contributed here. For now I'll focus on building the fpm documentation to explore how far we can get with sphinx. Maybe we can transfer some of the knowledge and experience from there to rebuilt our webpage with support for translations in the future. Having a multilingual Fortran homepage is still high on my wish list. |
#delete_preview |
The preview build for this PR has now been deleted. |
This patch introduces the infrastructure for localization support of the webpage using the jekyll-multiple-languages-plugin. You can checkout my
i18n
branch locally and add a new language as described in #197 (comment) to play around with the feature. Feedback is more than welcome on this patch._include
_layouts
localize permalinksThis PR does not add localization to any language yet, a build preview will only show if nothing is broken.This pull request includes the Spanish translation provided by @aslozada and the French translation provided by @vmagnin, the side can be previewed at https://fortran-lang.org/pr/201/.